<template>
	<div>
		<order-header :title="title">
			<template v-slot:tips>
				<span>{{tip}}</span>
			</template>
		</order-header>
		<router-view></router-view>
		<ServiceBar></ServiceBar>
		<nav-footer></nav-footer>
	</div>
</template>

<script>
	import OrderHeader from '../components/OrderHeader.vue'
	import NavFooter from '../components/NavFooter.vue'
	import ServiceBar from '../components/ServiceBar.vue'
	export default{
		components:{
			OrderHeader,
			NavFooter,
			ServiceBar
		},
		data(){
			return{
			  
			}
		},
		// created() {
		// 	console.log('fff')
		// 	let path=this.$route.path;
		// 	if(path=='/order/confirm'){
		// 		this.title="订单确认"
		// 		this.tip="赵小虎还牛逼"
		// 		}else if(path=='/order/list'){
		// 			this.title="订单列表"
		// 			this.tip="赵小虎真牛逼"
		// 		}else{
		// 			this.title="订单支付"
		// 			this.tip="赵小虎额牛逼"
		// 		}
		// },
		watch:{
			//监听路由变化
			// '$route.path':function(path,oldVal){
			// 	if(path=='/order/confirm'){
			// 		this.title="订单确认"
			// 		this.tip="赵小虎还牛逼"
			// 		}else if(path=='/order/list'){
			// 			this.title="订单列表"
			// 			this.tip="赵小虎真牛逼"
			// 		}else{
			// 			this.title="订单支付"
			// 			this.tip="赵小虎额牛逼"
			// 		}
			// }
		},
		computed:{
			title(){
				let path=this.$route.path;
				if(path=='/order/confirm'){
					return "订单确认"
					}else if(path=='/order/list'){
						return "订单列表"
					}else{
						return "订单支付"
					}
			},
			tip(){
				let path=this.$route.path;
				if(path=='/order/confirm'){
					return "赵小虎还牛逼"
					}else if(path=='/order/list'){
						return "赵小虎真牛逼"
					}else{
						return "赵小虎额牛逼"
					}
			}
		}
	}
</script>

<style>
</style>
